package cn.gd.service.Meetingroombookings;

import cn.gd.mapper.Meetingroombookings.MeetingRoomBookingMapper;
import cn.gd.pojo.MeetingroombookingTool.MeetingroombookingVo;
import cn.gd.pojo.Meetingroombookings;
import cn.gd.pojo.Meetingrooms;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wyh
 * @version 1.80
 */
@Service
public class MeetingRoomBookingServiceImpl implements MeetingRoomBookingService{

    @Autowired
    private MeetingRoomBookingMapper mapper;

    @Override
    public PageInfo<Meetingroombookings> getMeetingRoomBookingAll(
            MeetingroombookingVo meetingroombookingVo,
            Integer pageNo,
            Integer pageSize
    ) {
        PageHelper.startPage(pageNo,pageSize);
        return new PageInfo<>(mapper.getMeetingRoomBookingAll(meetingroombookingVo));
    }

    @Override
    public PageInfo<Meetingrooms> getMeetingRoomAll(MeetingroombookingVo meetingroombookingVo,Integer pageNo,
                                                Integer pageSize) {
        PageHelper.startPage(pageNo,pageSize);
        return new PageInfo<>(mapper.getMeetingRoomAll(meetingroombookingVo));
    }

    @Override
    public int addMeetingRoomBooking(Meetingroombookings meetingroombookings) {
        return mapper.addMeetingRoomBooking(meetingroombookings);
    }

    @Override
    public int deleteMeetingRoomBooking(int id) {
        return mapper.deleteMeetingRoomBooking(id);
    }
}
